package com.cc.pms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cc.pms.domain.vo.TeamVo;
import com.cc.pms.domain.Team;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 队伍表 Mapper 接口
 * </p>
 *
 * @author corleone
 * @since 2025-04-19
 */
public interface TeamMapper extends BaseMapper<Team> {


    Page<TeamVo> queryMineManageTeamVoPage(Page<TeamVo> page, @Param("captainId") Long captainId, @Param("team") Team team);


    Page<TeamVo> queryTeamVoPage(Page<TeamVo> page , @Param("team") Team team , @Param("beginTime") String beginTime , @Param("endTime") String endTime);


    Page<TeamVo> queryTeamVoPageByTagId(Page<TeamVo> page , @Param("userId") Long userId , @Param("tagIds") List<Long> tagIds);


    Page<TeamVo> queryTeamVoPageByName(Page<TeamVo> page , @Param("teamName") String teamName  , @Param("userId") Long userId);


    List<TeamVo> queryRandomTeamVoList(@Param("count") int count, @Param("userId") Long userId, @Param("excludedTeamIds") List<Long> excludedTeamIds);


    Long countTeamsExcludingIds( @Param("excludedTeamIds") List<Long> excludedTeamIds);


    TeamVo queryTeamByInviteCodeWithApplicationStatus(@Param("inviteCode") String inviteCode , @Param("userId") Long userId );


    Page<TeamVo> queryJoinTeamVoPage(Page<TeamVo> page, @Param("userId") Long userId, @Param("team") Team team);

}

